﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TinyERP.Framework.Controls
{
    public class KLabel: Label, ILocalizable
    {
        public string ResourceModuleKey { get; set; }
        public string ResourceKey { get; set; }
        public void UpdateLanguage()
        {
            string textFromResource = "";
            if (!string.IsNullOrEmpty(this.ResourceModuleKey))
            {
                textFromResource = ModuleResourceManager.GetInstance().GetString(ResourceKey, ResourceModuleKey);
            }
            else
            {
                textFromResource = AppResourceManager.GetInstance().GetString(ResourceKey);
            }
            if (!string.IsNullOrEmpty(textFromResource))
            {
                this.Text = textFromResource;
            }
        }

    }
}
